package com.village.friend.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.village.friend.entity.User;
import com.village.friend.mapper.UserMapper;
import com.village.friend.service.UserService;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;


/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author yl
 * @since 2021-11-13
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public Integer updateVipByUid(Integer uid, Integer vipLevel, LocalDateTime vipEnd) {
        return baseMapper.updateVipByUid(uid, vipLevel, vipEnd);
    }

    @Override
    public Integer updateGenderByUid(Integer uid, Integer gender, String name) {
        return baseMapper.updateGenderByUid(uid, gender, name);
    }

    @Override
    public Integer updateGenderInviteByUid(Integer uid, Integer gender, String name, Integer parent, String inviteCode) {
        return baseMapper.updateGenderInviteByUid(uid, gender, name,parent,inviteCode);
    }

    @Override
    public Integer updateUserByUid(Integer id, String nickname, String avatarurl, String birth, Integer height, Integer weight, String photos, Integer isHide, Integer isFreeze, Integer isLogout, Integer vipLevel, String city, String selfDesc, String profession, String salaryYear, String weChatAccount, String flags) {
        return baseMapper.updateUserByUid(id, nickname, avatarurl, birth, height, weight, photos, isHide, isFreeze, isLogout, vipLevel, city, selfDesc, profession, salaryYear, weChatAccount, flags);
    }

    @Override
    public User getUserByUserId(Integer uid, Double latitude, Double longitude) {
        return baseMapper.getUserByUserId(uid, longitude, latitude);
    }

    @Override
    public User getUserByUserMobile(String mobile, Double latitude, Double longitude) {
        return baseMapper.getUserByUserMobile(mobile, longitude, latitude);
    }

    @Override
    public Integer updateHeart(Integer uid, String city, Double longitude, Double latitude) {
        return baseMapper.updateHeart(uid, city, longitude, latitude);
    }


    @Override
    public List<User> list(Integer userId, Integer gender, String city, Integer ageStart, Integer ageEnd, Integer heightStart, Integer heightEnd, String salaryYear, Double latitude, Double longitude, Integer offset, Integer limit, Integer mode) {
        return baseMapper.list(userId, gender, city, ageStart, ageEnd, heightStart, heightEnd, salaryYear, latitude, longitude, offset, limit, mode);
    }

    @Override
    public Integer listCount(Integer userId, Integer gender, String city, Integer ageStart, Integer ageEnd, Integer heightStart, Integer heightEnd, String salaryYear) {
        return baseMapper.listCount(userId, gender, city, ageStart, ageEnd, heightStart, heightEnd, salaryYear);
    }


}
